%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for mutations/basics/delete-relational-post"
    Bucket0("Bucket 0 (root)"):::bucket
    Bucket1("Bucket 1 (mutationField)<br />Deps: 11, 118, 2"):::bucket
    Bucket2("Bucket 2 (mutationField)<br />Deps: 119, 2<br /><br />1: Access[15]<br />2: Access[16]<br />3: Object[17]<br />4: PgDeleteSingle[14]"):::bucket
    Bucket3("Bucket 3 (nullableBoundary)<br />Deps: 8, 2<br /><br />ROOT PgDeleteSingle{1}ᐸrelational_posts(id)ᐳ[8]<br />1: 92, 101<br />ᐳ: 19, 24, 25, 100, 18, 22, 26<br />2: PgSelectInlineApply[96]<br />3: PgSelect[23]<br />ᐳ: Access[97], Access[102]<br />4: PgSelectRows[28]<br />ᐳ: First[27], PgSelectSingle[29]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 14, 2<br /><br />ROOT PgDeleteSingle{2}ᐸrelational_posts(id)ᐳ[14]<br />1: 105, 114<br />ᐳ: 21, 32, 33, 113, 20, 30, 34<br />2: PgSelectInlineApply[109]<br />3: PgSelect[31]<br />ᐳ: Access[110], Access[115]<br />4: PgSelectRows[36]<br />ᐳ: First[35], PgSelectSingle[37]"):::bucket
    Bucket5("Bucket 5 (nullableBoundary)<br />Deps: 29, 8, 97, 102<br /><br />ROOT PgSelectSingle{3}ᐸrelational_postsᐳ[29]<br />1: <br />ᐳ: 38, 40, 42, 44, 98, 103, 99, 104, 93<br />2: PgSelectRows[53], PgSelectRows[69]<br />ᐳ: 52, 54, 55, 68, 70, 94, 95<br />3: PgSelectRows[75]<br />ᐳ: First[74], PgSelectSingle[76]"):::bucket
    Bucket6("Bucket 6 (nullableBoundary)<br />Deps: 37, 14, 110, 115<br /><br />ROOT PgSelectSingle{4}ᐸrelational_postsᐳ[37]<br />1: <br />ᐳ: 39, 41, 43, 45, 111, 116, 112, 117, 106<br />2: PgSelectRows[63], PgSelectRows[80]<br />ᐳ: 62, 64, 65, 79, 81, 107, 108<br />3: PgSelectRows[86]<br />ᐳ: First[85], PgSelectSingle[87]"):::bucket
    Bucket7("Bucket 7 (nullableBoundary)<br />Deps: 76, 8<br /><br />ROOT PgSelectSingle{5}ᐸpeopleᐳ[76]"):::bucket
    Bucket8("Bucket 8 (nullableBoundary)<br />Deps: 87, 14<br /><br />ROOT PgSelectSingle{6}ᐸpeopleᐳ[87]"):::bucket
    end
    Bucket0 --> Bucket1 & Bucket2
    Bucket1 --> Bucket3
    Bucket2 --> Bucket4
    Bucket3 --> Bucket5
    Bucket4 --> Bucket6
    Bucket5 --> Bucket7
    Bucket6 --> Bucket8

    %% plan dependencies
    Object11{{"Object[11∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access9 & Access10 --> Object11
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ<br />Dependents: 8"]:::plan
    PgDeleteSingle8[["PgDeleteSingle[8∈1] ➊<br />ᐸrelational_posts(id)ᐳ<br />More deps:<br />- Constantᐸ4ᐳ[118]"]]:::sideeffectplan
    Object11 --> PgDeleteSingle8
    PgDeleteSingle14[["PgDeleteSingle[14∈2] ➊<br />ᐸrelational_posts(id)ᐳ<br />More deps:<br />- Constantᐸ3141592ᐳ[119]"]]:::sideeffectplan
    Object17{{"Object[17∈2] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Object17 --> PgDeleteSingle14
    Access15{{"Access[15∈2] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access16{{"Access[16∈2] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access15 & Access16 --> Object17
    PgSelect23[["PgSelect[23∈3] ➊<br />ᐸrelational_postsᐳ"]]:::plan
    Object26{{"Object[26∈3] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    PgClassExpression22{{"PgClassExpression[22∈3] ➊<br />ᐸ__relational_posts__ᐳ"}}:::plan
    PgSelectInlineApply96["PgSelectInlineApply[96∈3] ➊"]:::plan
    PgFromExpression100{{"PgFromExpression[100∈3] ➊"}}:::plan
    PgSelectInlineApply101["PgSelectInlineApply[101∈3] ➊"]:::plan
    Object26 & PgClassExpression22 & PgSelectInlineApply96 & PgFromExpression100 & PgSelectInlineApply101 --> PgSelect23
    Access24{{"Access[24∈3] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access25{{"Access[25∈3] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access24 & Access25 --> Object26
    PgClassExpression18{{"PgClassExpression[18∈3] ➊<br />ᐸ__relation...sts__.”id”ᐳ"}}:::plan
    Access19{{"Access[19∈3] ➊<br />ᐸ8.tᐳ"}}:::plan
    Access19 --> PgClassExpression18
    PgDeleteSingle8 --> Access19
    Access19 --> PgClassExpression22
    First27{{"First[27∈3] ➊"}}:::plan
    PgSelectRows28[["PgSelectRows[28∈3] ➊"]]:::plan
    PgSelectRows28 --> First27
    PgSelect23 --> PgSelectRows28
    PgSelectSingle29{{"PgSelectSingle[29∈3] ➊<br />ᐸrelational_postsᐳ"}}:::plan
    First27 --> PgSelectSingle29
    PgSelectInlineApply92["PgSelectInlineApply[92∈3] ➊"]:::plan
    PgSelectInlineApply92 --> PgSelectInlineApply96
    Access97{{"Access[97∈3] ➊<br />ᐸ23.m.joinDetailsFor66ᐳ"}}:::plan
    PgSelect23 --> Access97
    Access102{{"Access[102∈3] ➊<br />ᐸ23.m.joinDetailsFor47ᐳ"}}:::plan
    PgSelect23 --> Access102
    PgSelect31[["PgSelect[31∈4] ➊<br />ᐸrelational_postsᐳ"]]:::plan
    Object34{{"Object[34∈4] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    PgClassExpression30{{"PgClassExpression[30∈4] ➊<br />ᐸ__relational_posts__ᐳ"}}:::plan
    PgSelectInlineApply109["PgSelectInlineApply[109∈4] ➊"]:::plan
    PgFromExpression113{{"PgFromExpression[113∈4] ➊"}}:::plan
    PgSelectInlineApply114["PgSelectInlineApply[114∈4] ➊"]:::plan
    Object34 & PgClassExpression30 & PgSelectInlineApply109 & PgFromExpression113 & PgSelectInlineApply114 --> PgSelect31
    Access32{{"Access[32∈4] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access33{{"Access[33∈4] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access32 & Access33 --> Object34
    PgClassExpression20{{"PgClassExpression[20∈4] ➊<br />ᐸ__relation...sts__.”id”ᐳ"}}:::plan
    Access21{{"Access[21∈4] ➊<br />ᐸ14.tᐳ"}}:::plan
    Access21 --> PgClassExpression20
    PgDeleteSingle14 --> Access21
    Access21 --> PgClassExpression30
    First35{{"First[35∈4] ➊"}}:::plan
    PgSelectRows36[["PgSelectRows[36∈4] ➊"]]:::plan
    PgSelectRows36 --> First35
    PgSelect31 --> PgSelectRows36
    PgSelectSingle37{{"PgSelectSingle[37∈4] ➊<br />ᐸrelational_postsᐳ"}}:::plan
    First35 --> PgSelectSingle37
    PgSelectInlineApply105["PgSelectInlineApply[105∈4] ➊"]:::plan
    PgSelectInlineApply105 --> PgSelectInlineApply109
    Access110{{"Access[110∈4] ➊<br />ᐸ31.m.joinDetailsFor77ᐳ"}}:::plan
    PgSelect31 --> Access110
    Access115{{"Access[115∈4] ➊<br />ᐸ31.m.joinDetailsFor57ᐳ"}}:::plan
    PgSelect31 --> Access115
    List94{{"List[94∈5] ➊<br />ᐸ93,70ᐳ"}}:::plan
    Access93{{"Access[93∈5] ➊<br />ᐸ99.m.joinDetailsFor72ᐳ"}}:::plan
    PgSelectSingle70{{"PgSelectSingle[70∈5] ➊<br />ᐸrelational_itemsᐳ"}}:::plan
    Access93 & PgSelectSingle70 --> List94
    List98{{"List[98∈5] ➊<br />ᐸ97,29ᐳ"}}:::plan
    Access97 & PgSelectSingle29 --> List98
    List103{{"List[103∈5] ➊<br />ᐸ102,29ᐳ"}}:::plan
    Access102 & PgSelectSingle29 --> List103
    PgClassExpression38{{"PgClassExpression[38∈5] ➊<br />ᐸ__relation...sts__.”id”ᐳ"}}:::plan
    PgSelectSingle29 --> PgClassExpression38
    PgClassExpression40{{"PgClassExpression[40∈5] ➊<br />ᐸ__relation...__.”title”ᐳ"}}:::plan
    PgClassExpression38 o--o PgClassExpression40
    PgClassExpression42{{"PgClassExpression[42∈5] ➊<br />ᐸ__relation...scription”ᐳ"}}:::plan
    PgClassExpression40 o--o PgClassExpression42
    PgClassExpression44{{"PgClassExpression[44∈5] ➊<br />ᐸ__relation...s__.”note”ᐳ"}}:::plan
    PgClassExpression42 o--o PgClassExpression44
    First52{{"First[52∈5] ➊"}}:::plan
    PgSelectRows53[["PgSelectRows[53∈5] ➊"]]:::plan
    PgSelectRows53 --> First52
    Lambda104{{"Lambda[104∈5] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda104 --> PgSelectRows53
    PgSelectSingle54{{"PgSelectSingle[54∈5] ➊<br />ᐸtextᐳ"}}:::plan
    First52 --> PgSelectSingle54
    PgClassExpression55{{"PgClassExpression[55∈5] ➊<br />ᐸ__relation..._lower__.vᐳ"}}:::plan
    PgSelectSingle54 --> PgClassExpression55
    First68{{"First[68∈5] ➊"}}:::plan
    PgSelectRows69[["PgSelectRows[69∈5] ➊"]]:::plan
    PgSelectRows69 --> First68
    Lambda99{{"Lambda[99∈5] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda99 --> PgSelectRows69
    First68 --> PgSelectSingle70
    First74{{"First[74∈5] ➊"}}:::plan
    PgSelectRows75[["PgSelectRows[75∈5] ➊"]]:::plan
    PgSelectRows75 --> First74
    Lambda95{{"Lambda[95∈5] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda95 --> PgSelectRows75
    PgSelectSingle76{{"PgSelectSingle[76∈5] ➊<br />ᐸpeopleᐳ"}}:::plan
    First74 --> PgSelectSingle76
    Lambda99 --> Access93
    List94 --> Lambda95
    List98 --> Lambda99
    List103 --> Lambda104
    List107{{"List[107∈6] ➊<br />ᐸ106,81ᐳ"}}:::plan
    Access106{{"Access[106∈6] ➊<br />ᐸ112.m.joinDetailsFor83ᐳ"}}:::plan
    PgSelectSingle81{{"PgSelectSingle[81∈6] ➊<br />ᐸrelational_itemsᐳ"}}:::plan
    Access106 & PgSelectSingle81 --> List107
    List111{{"List[111∈6] ➊<br />ᐸ110,37ᐳ"}}:::plan
    Access110 & PgSelectSingle37 --> List111
    List116{{"List[116∈6] ➊<br />ᐸ115,37ᐳ"}}:::plan
    Access115 & PgSelectSingle37 --> List116
    PgClassExpression39{{"PgClassExpression[39∈6] ➊<br />ᐸ__relation...sts__.”id”ᐳ"}}:::plan
    PgSelectSingle37 --> PgClassExpression39
    PgClassExpression41{{"PgClassExpression[41∈6] ➊<br />ᐸ__relation...__.”title”ᐳ"}}:::plan
    PgClassExpression39 o--o PgClassExpression41
    PgClassExpression43{{"PgClassExpression[43∈6] ➊<br />ᐸ__relation...scription”ᐳ"}}:::plan
    PgClassExpression41 o--o PgClassExpression43
    PgClassExpression45{{"PgClassExpression[45∈6] ➊<br />ᐸ__relation...s__.”note”ᐳ"}}:::plan
    PgClassExpression43 o--o PgClassExpression45
    First62{{"First[62∈6] ➊"}}:::plan
    PgSelectRows63[["PgSelectRows[63∈6] ➊"]]:::plan
    PgSelectRows63 --> First62
    Lambda117{{"Lambda[117∈6] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda117 --> PgSelectRows63
    PgSelectSingle64{{"PgSelectSingle[64∈6] ➊<br />ᐸtextᐳ"}}:::plan
    First62 --> PgSelectSingle64
    PgClassExpression65{{"PgClassExpression[65∈6] ➊<br />ᐸ__relation..._lower__.vᐳ"}}:::plan
    PgSelectSingle64 --> PgClassExpression65
    First79{{"First[79∈6] ➊"}}:::plan
    PgSelectRows80[["PgSelectRows[80∈6] ➊"]]:::plan
    PgSelectRows80 --> First79
    Lambda112{{"Lambda[112∈6] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda112 --> PgSelectRows80
    First79 --> PgSelectSingle81
    First85{{"First[85∈6] ➊"}}:::plan
    PgSelectRows86[["PgSelectRows[86∈6] ➊"]]:::plan
    PgSelectRows86 --> First85
    Lambda108{{"Lambda[108∈6] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda108 --> PgSelectRows86
    PgSelectSingle87{{"PgSelectSingle[87∈6] ➊<br />ᐸpeopleᐳ"}}:::plan
    First85 --> PgSelectSingle87
    Lambda112 --> Access106
    List107 --> Lambda108
    List111 --> Lambda112
    List116 --> Lambda117
    PgClassExpression88{{"PgClassExpression[88∈7] ➊<br />ᐸ__people__.”person_id”ᐳ"}}:::plan
    PgSelectSingle76 --> PgClassExpression88
    PgClassExpression90{{"PgClassExpression[90∈7] ➊<br />ᐸ__people__.”username”ᐳ"}}:::plan
    PgClassExpression88 o--o PgClassExpression90
    PgClassExpression89{{"PgClassExpression[89∈8] ➊<br />ᐸ__people__.”person_id”ᐳ"}}:::plan
    PgSelectSingle87 --> PgClassExpression89
    PgClassExpression91{{"PgClassExpression[91∈8] ➊<br />ᐸ__people__.”username”ᐳ"}}:::plan
    PgClassExpression89 o--o PgClassExpression91

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,Access9,Access10,Object11 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgDeleteSingle8 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,PgDeleteSingle14,Access15,Access16,Object17 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3,PgClassExpression18,Access19,PgClassExpression22,PgSelect23,Access24,Access25,Object26,First27,PgSelectRows28,PgSelectSingle29,PgSelectInlineApply92,PgSelectInlineApply96,Access97,PgFromExpression100,PgSelectInlineApply101,Access102 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,PgClassExpression20,Access21,PgClassExpression30,PgSelect31,Access32,Access33,Object34,First35,PgSelectRows36,PgSelectSingle37,PgSelectInlineApply105,PgSelectInlineApply109,Access110,PgFromExpression113,PgSelectInlineApply114,Access115 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,PgClassExpression38,PgClassExpression40,PgClassExpression42,PgClassExpression44,First52,PgSelectRows53,PgSelectSingle54,PgClassExpression55,First68,PgSelectRows69,PgSelectSingle70,First74,PgSelectRows75,PgSelectSingle76,Access93,List94,Lambda95,List98,Lambda99,List103,Lambda104 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,PgClassExpression39,PgClassExpression41,PgClassExpression43,PgClassExpression45,First62,PgSelectRows63,PgSelectSingle64,PgClassExpression65,First79,PgSelectRows80,PgSelectSingle81,First85,PgSelectRows86,PgSelectSingle87,Access106,List107,Lambda108,List111,Lambda112,List116,Lambda117 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgClassExpression88,PgClassExpression90 bucket7
    classDef bucket8 stroke:#dda0dd
    class Bucket8,PgClassExpression89,PgClassExpression91 bucket8

    %% implicit side effects
    PgDeleteSingle8 -.-o Access24
    PgDeleteSingle8 -.-o Access25
    PgDeleteSingle8 -.-o PgSelectInlineApply92
    PgDeleteSingle8 -.-o PgFromExpression100
    PgDeleteSingle8 -.-o PgSelectInlineApply101
    PgDeleteSingle14 -.-o Access32
    PgDeleteSingle14 -.-o Access33
    PgDeleteSingle14 -.-o PgSelectInlineApply105
    PgDeleteSingle14 -.-o PgFromExpression113
    PgDeleteSingle14 -.-o PgSelectInlineApply114

